]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
loginDialog: Don't call _loginScreenSessionActivated() when not required
authorAlessandro Bono <alessandro.bono369@gmail.com>
Mon, 8 Aug 2022 11:33:53 +0000 (13:33 +0200)
committerMarge Bot <marge-bot@gnome.org>
Wed, 10 Aug 2022 09:48:35 +0000 (09:48 +0000)
We are calling _loginScreenSessionActivated() even in cases where this is
not required. For example, there are cases where the Active property is
already `true` and properties like `IdleHint`, `IdleSinceHint` and
`IdleSinceHintMonotonic` change. In this cases _loginScreenSessionActivated()
is called and will reset the authPrompt when not necessary.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2411>

js/gdm/loginDialog.js

index bd1a6591a1659d6946706069d915183cb14ba049..607193677017fb5aa9b0c28fc79e25ba137a591d 100644 (file)
@@ -985,8 +985,9 @@ var LoginDialog = GObject.registerClass({
     async _getGreeterSessionProxy() {
         const loginManager = LoginManager.getLoginManager();
         this._greeterSessionProxy = await loginManager.getCurrentSessionProxy();
-        this._greeterSessionProxy?.connectObject('g-properties-changed', () => {
-            if (this._greeterSessionProxy.Active)
+        this._greeterSessionProxy?.connectObject('g-properties-changed', (proxy, properties) => {
+            const activeChanged = !!properties.lookup_value('Active', null);
+            if (activeChanged && proxy.Active)
                 this._loginScreenSessionActivated();
         }, this);
     }